package timer;


/**
 * clasa ce se ocupa de modificarea ceasului din 30 in 30 de secunde
 *
 */
public class Watch implements java.io.Serializable,TimerListener {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	/* Properties */
	protected String name = null;
	private float power = 0;

	/* Empty Constructor */
	public Watch() {}

	/* Getter and Setter Methods */
	public String getName() {
		return name;
	}

	public void setName(String s) {
		name = s;
	}

	public float getPower() {
		return power;
	}

	public void setPower(float i) {
		power = i;
	}

	/**
	 * modifica ceasul cu 30 de secunde
	 */
	@Override
	public void timeElapsed(TimerEvent evt) {
		// TODO Auto-generated method stub
		int zi=TimerEvent.now.getDay();
		TimerEvent.now.setSeconds(TimerEvent.now.getSeconds()+30);
		if (zi+1==TimerEvent.now.getDay())
		{
			System.exit(1);
		}		
	}
}